<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="../../styles/estilo1.css" rel="stylesheet" type="text/css" />
<link href="../../styles/sticker.css" rel="stylesheet" type="text/css"  />
<script language="javascript" src="../../js/prototype.js">
</script>
<script language="javascript"> 
function refrescatabla(){
	//alert($F("rol"));
	//alert($F("conferencia"));
	var params = { rol: $F("rol"),
				   conferencia : $F("conferencia"),
				   fecha : $F("fecha")
				   }
    new Ajax.Updater('tabla',
						 './consultar/listado.php',
						  {asynchronous:true, parameters:params}
						  );
	
}
</script>
<title>Documento sin t&iacute;tulo</title>
</head>

<body onload="refrescatabla(); return false;">
<?php $ruta_raiz = "../../";
	include("$ruta_raiz/adodb/adodb.inc.php");
	include("$ruta_raiz/config.php");
	
	$db = NewADOConnection('mysql');
	//$db->debug = true;
  	$db->Connect("$host", "$root_user", "$passwd", "$dbname");
	
?>

<div align="center">
<form action="" method="post" name="consulta">
<table width="500" border="0">
  <tr>
    <td width="50%" align="right" class="body">Tipo de Asistente</td>
    <td class="bodyform" >
	<?php
$rs=$db->Execute('select roles.rol_id as "rol_id", roles.rol_nombre as "rol_nombre" from roles, evento where roles.rol_evento = evento.evn_id && evento.evn_id = '.$evento.''); ?>
        <select name="rol" class="bodyform" id="rol" onchange="refrescatabla(); return false;"  >
        <?php while(!$rs->EOF){ ?>
          <option value="<?php echo $rs->fields['rol_id'];?>" ><?php echo $rs->fields['rol_nombre']?></option>
          <? $rs->MoveNext(); ?>
          <? } ?>
        </select>
      </label></td>
  </tr>
  <tr>
    <td width="50%" align="right" class="body">Conferencia</td>
    <td><select name="conferencia" id="conferencia" class="bodyform" onchange="refrescatabla(); return false;" >
      <?php $rs = $db->Execute('select conferencia.confe_id as "confe_id", conferencia.confe_nombre as "confe_nombre" from conferencia, evento where evento.evn_id='.$evento.' && conferencia.confe_evento=evento.evn_id'); 
      while(!$rs->EOF){ ?>
   
      <option value="<?php echo $rs->fields['confe_id'];?>" ><?php echo $rs->fields['confe_id'].'. '.$rs->fields['confe_nombre'];?> </option>
      <? $rs->MoveNext();
	  } ?>
      </select></td>
  </tr>
  <tr>
    <td width="50%" align="right" class="body">Fecha</td>
    <td><select name="fecha" id="fecha" class="bodyform" onchange="refrescatabla(); return false;" >
      <?php $rs = $db->Execute('SELECT asistencia.asis_fecha as "asis_fecha" FROM asistencia, evento where evento.evn_id = asistencia.asis_evento && evento.evn_id = '.$evento.' group by asistencia.asis_fecha'); 
      while(!$rs->EOF){ ?>
      <option value="<?php 
	  $fecha = strftime('%d-%m-%Y',strtotime($rs->fields['asis_fecha']));
	  echo $rs->fields['asis_fecha'];?>" ><?php echo $fecha;?> </option>
      <? $rs->MoveNext();
	  } ?>
      </select></td>
  </tr>
  <tr>
    <td colspan="2" align="center">&nbsp;</td>
  </tr>
</table>

</form>
<div id="tabla">

</div>
</body>
</html>